﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormsAppweek2
{
    public partial class WorkersForm: Form
    {
        public WorkersForm()
        {
            InitializeComponent();
        }

        private void WorkersForm_Load(object sender, EventArgs e)
        {
            this.tblWorkerTableAdapter.Fill(this.cMSDatabaseDataSet2.tblWorker);

        }


        private void buttonSave_Click(object sender, EventArgs e)
        {
            sqlDataAdapter1.Update(this.cMSDatabaseDataSet2.tblWorker);
            MessageBox.Show("updated");
        }

        private void buttonEdit_Click(object sender, EventArgs e)
        {
            this.cMSDatabaseDataSet2.tblWorker.Clear();
            sqlDataAdapter1.Fill(this.cMSDatabaseDataSet2.tblWorker);
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.cMSDatabaseDataSet2.tblWorker.Clear();
            sqlDataAdapter1.Fill(this.cMSDatabaseDataSet2.tblWorker);
        }

        private void buttonExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
